package com.zhangyu.shadow.ec.main.personal.list;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.zhangyu.shadow.core.delegate.ShadowDelegate;

/**
 * @author zhangyu
 * @date 2017/12/22
 */

public class ListBean implements MultiItemEntity {
    private int mId;
    private String mName;
    private String mUrl;
    private String mValue;
    private int mItemType;
    private ShadowDelegate mDelegate;

    public ListBean(int id, String name, String url, int itemType, String value, ShadowDelegate delegate) {
        mId = id;
        mName = name;
        mUrl = url;
        mItemType = itemType;
        mValue = value;
        mDelegate = delegate;
    }

    public String getValue() {
        return mValue;
    }

    @Override
    public int getItemType() {
        return mItemType;
    }

    public int getId() {
        return mId;
    }

    public String getName() {
        return mName == null ? "" : mName;
    }

    public String getUrl() {
        return mUrl;
    }

    public ShadowDelegate getDelegate() {
        return mDelegate;
    }

    public static final class Builder {
        private int mId;
        private String mName;
        private String mUrl;
        private int mItemType;
        private String mValue;
        private ShadowDelegate mDelegate;

        public Builder setId(int id) {
            mId = id;
            return this;
        }

        public Builder setValue(String value) {
            mValue = value;
            return this;
        }

        public Builder setName(String name) {
            mName = name;
            return this;
        }

        public Builder setUrl(String url) {
            mUrl = url;
            return this;
        }

        public Builder setItemType(int itemType) {
            mItemType = itemType;
            return this;
        }

        public Builder setDelegate(ShadowDelegate delegate) {
            mDelegate = delegate;
            return this;
        }

        public ListBean build() {
            return new ListBean(mId, mName, mUrl, mItemType, mValue, mDelegate);
        }
    }
}
